{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script src="{% static 'myajax.js' %}"></script>

    <script type="text/javascript">
        $(function () {
            $("#submits").click(function (event) {
                event.preventDefault(); //阻止默认提交
                var email = $("input[name='email']").val();
                var money = $("input[name='money']").val();

                myajax.post({
                    'url':'/transfer/',
                    'data':{
                        'email':email,
                        'money':money,
                    },
                    success:function (data) {
                        console.log(data)
                    },
                    fail:function (error) {
                        console.log(error)
                    }
                })

            })
        })
    </script>

</head>
<body>
    <h1>转账</h1>
    <form action="" method="post">
    <table>
        <tbody>
            <tr>
                <td>转给：</td>
                <td><input type="text" name="email"></td>
            </tr>
            <tr>
                <td>金额：</td>
                <td><input type="text" name="money"></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" id="submits" value="提交"></td>
            </tr>
        </tbody>
    </table>
</form>
</body>
</html>